[Core] Improve UX when defining template of a Component#6161
Conversation
|
Hello, +1 for proposing a path to remove the "template" keyword. |
|
@damienmarchal I see only two options:
Actually, more generally, this PR defines the template parameters as an associative container key-value. And you are right, the user must know the key. But it is also the case for the Data. We found "solutions" for that: documentation (including the examples) and auto-completion. |
|
Third option : We propose a "DataTypeParameters" component, holding all of such parameter for one node, fixing the parameters for all component in this node. Then because it is a component, the user will know where to look for. |
To me "template" is just a bad name (a c++ concept) with very limit meaning for scenes makers. dataType or simply "type" is probably better. I'm unsure of the use of per component "type" because I will hide the fact this is a special purpose "keyword" and not a data. About the implementation you are proposing, your are refering to the use of a "container key-value" then saying "the user must know the key". To me if you are using container then there could be multiple keys not a single one (this is what I understand from the use of the singular form for "key"). So if there is multiple "key", then theses are aliases I would not recommend to introduce. "template" should be a corner case just there to emit a warning to inform users to stop using this name and suggesting the new name. |
To get rid of the
templatekeyword when defining a Component. Example:By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if